package org.linlinjava.litemall.db.service;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.linlinjava.litemall.db.dao.LumiereGoodsFormulaCorrelationMapper;
import org.linlinjava.litemall.db.domain.LumiereGoodsFormulaCorrelation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LumiereGoodsFormulaCorrelationService extends MPJBaseServiceImpl<LumiereGoodsFormulaCorrelationMapper, LumiereGoodsFormulaCorrelation> {

    @Autowired
    private LumiereGoodsFormulaCorrelationMapper lumiereGoodsFormulaCorrelationMapper;

    /**
     * 商品Id获取 配方
     * @param goodsId
     * @return
     */
    public LumiereGoodsFormulaCorrelation getGoodsFormulaByGoodsId(Integer goodsId){
        return lumiereGoodsFormulaCorrelationMapper.selectOne(Wrappers.lambdaQuery(LumiereGoodsFormulaCorrelation.class).eq(LumiereGoodsFormulaCorrelation::getGoodsId, goodsId));
    }

}
